package com.wlw.web;
import java.util.List;

import javax.servlet.http.HttpServletRequest;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import com.wlw.entity.Scenery;
import com.wlw.service.SceneryService;

import edu.xjsoft.base.orm.support.PropertyFilter;

@Controller
@RequestMapping("/scenery/*")
public class SceneryAction {
	@Autowired
	private SceneryService sceneryService;
	
	@RequestMapping("sceneryDetail")
	public String sceneryDetail(HttpServletRequest req,Model model){
		int id = Integer.parseInt(req.getParameter("id"));
		PropertyFilter filters = new PropertyFilter("id", id);
		System.out.println(id);
		List<Scenery> sceneries = sceneryService.search(filters);
		model.addAttribute("sceneries", sceneries);
		return "foreground/sceneryDetail";
	}
}
